package com.demo.util;

import java.awt.*;
import java.io.File;

public class FileUtil {

    public static void openFile(String filePath) {
        try {
            File file = new File(filePath);
            if (!Desktop.isDesktopSupported()) {
                System.out.println("not supported");
                return;
            }
            Desktop desktop = Desktop.getDesktop();
            if (file.exists()){
                desktop.open(file);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
